CC = g++
objects = TFrame.o
bindir = ./bin/
srcdir = ./src/
incdir = ./include/
PPPMST = pppmst.o
PPPMERGE = pppmerge.o
DBITVEC = dbitvec.o
TRANSLATE = translate.o
regmain = regmain
generate = generate
PROGRAM = program
#LIBS=-I/usr/include/glib-2.0/ -I/usr/lib/glib-2.0/include/ -I/usr/include/libgtop-2.0/ -lgtop-2.0 -lglib-2.0
FLAGS=-O3 -Wall -Wno-deprecated -pg # -g if debug is needed

.PHONY: clean

$(bindir)$(PROGRAM): $(srcdir)main.cpp $(bindir)$(PPPMST) $(bindir)$(PPPMERGE) $(bindir)$(DBITVEC) $(bindir)$(objects) $(bindir)$(TRANSLATE)
	$(CC) $(FLAGS) -o $@ $< $(bindir)$(objects) $(bindir)$(DBITVEC) $(bindir)$(TRANSLATE) -I $(incdir) -pthread $(LIBS)

Test: $(bindir)$(regmain)

Generate: $(bindir)$(generate)

$(bindir)$(regmain): $(srcdir)regmain.cpp $(bindir)$(PPPMST) $(bindir)$(PPPMERGE) $(bindir)$(DBITVEC) $(bindir)$(objects) $(bindir)$(TRANSLATE)
	$(CC) $(FLAGS) -o $@ $< $(bindir)$(objects) $(bindir)$(DBITVEC) $(bindir)$(TRANSLATE) -I $(incdir) -pthread $(LIBS)

$(bindir)$(generate): $(srcdir)generate.cpp
	$(CC) $(FLAGS) -o $@ $< 

$(bindir)$(PPPMST): $(incdir)pppmst.h $(bindir)$(PPPMERGE)
	$(CC) $(FLAGS) -c -o $@ $< -I $(incdir) -pthread $(LIBS) 

$(bindir)$(PPPMERGE): $(incdir)pppmerge.h
	$(CC) $(FLAGS) -c -o $@ $< -I $(incdir) -pthread $(LIBS)

$(bindir)$(DBITVEC): $(srcdir)dbitvec.cpp $(incdir)dbitvec.h
	$(CC) $(FLAGS) -c -o $@ $< -I $(incdir) -pthread $(LIBS)

$(bindir)$(TRANSLATE): $(srcdir)translate.cpp $(incdir)translate.h
	$(CC) $(FLAGS) -c -o $@ $< -I $(incdir) -pthread $(LIBS)

$(bindir)$(objects): $(srcdir)TFrame.cpp $(incdir)TFrame.h $(incdir)Task.h
	$(CC) $(FLAGS) -c -o $@ $< -I $(incdir) $(LIBS) -pthread -lboost_graph


clean:
	rm -rf $(bindir)*
